//头像上传的js
//点击修改按钮跳转到upload页面中，
$(".modify-photo").click(function () {
    window.location.href="/fresh/customer/upload.jsp"
})

//根据用户id查询用户的信息
getMess();
function getMess() {
    var customerId = $(".customerid").val();
    console.log(customerId);
    $.ajax({
        type:"GET",
        url:"/fresh/customer/getMess/"+customerId,
        datatype:"json",
        success:function (result) {
            if (result.status ==1){
                console.log("查询成功");
                //获取数据 渲染页面
                var customerName = result.data.customerName;
                var img = result.data.customerImages;
                var customerTelno = result.data.customerTelno;
                var customerGender = result.data.customerGender;
                console.log("img:"+img);
                console.log("customerName"+customerName);
                console.log("customerTelno"+customerTelno);


                $(".u-img").attr("src",img);
                $(".name").html(customerName);
                $(".phone-mess").html(customerTelno)
            }else {
                console.log("查询失败");
            }
        }
    })

}

